<%@ page language="java"  pageEncoding="UTF-8" contentType="text/html; charset=UTF-8" isELIgnored="false" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="../../js/jquery-3.3.1.js" type="text/javascript" charset="utf-8"></script>
    <script src="../../js/bootstrap.js" type="text/javascript" charset="utf-8"></script>
    <link rel="stylesheet" type="text/css" href="../../css/bootstrap.css"/>
    <style>
        #department-tb{
            width: 700px;
            margin: 0;
            border: 1px solid black;
            border-collapse: collapse;
            /*background-image: url(../../images/3.jpg);*/
        }
        #department-tb th,td{
            border: 1px solid black;
            padding: 5px;
            text-align: center;
            width: 5px;
            font-size: small;
            color: white;
        }
        .my-nav{
            margin-left: 200px;
        }
    </style>
</head>
<body style="background-image: url(../../images/3.jpg)" >
<table id="department-tb">

    <caption></caption>
    <tr>
        <th>编号</th>
        <th>名称</th>
        <th>创建时间</th>
        <th>创建人</th>
        <th>修改时间</th>
        <th>修改人</th>
        <th>状态</th>
    </tr>
    <form  method="post" id="dep-form">
    <c:forEach items="${departments}" var="department" varStatus="status">


                <tr>

                    <td><input type="checkbox" name="departmentIds" value="${department.departmentId}">${status.index + 1 }</td>
                    <td>${department.departmentName}</td>
                    <td>${department.createTime}</td>
                    <td>${department.founder}</td>
                    <td>${department.modificationTime}</td>
                    <td>${department.modifier}</td>
                    <td>
                    <c:if test="${department.state == 1}" >
                        启用
                    </c:if>
                    <c:if test="${department.state != 1}" >
                        停用
                    </c:if>
                    </td>

<%--                    <td><input type="submit" value="切换"></td>--%>
                </tr>

    </c:forEach>
    </form>
</table>
<nav class="my-nav" aria-label="Page navigation">

    <ul class="pagination">
        <li>
            <a href="second?page=1" aria-label="Previous">
                <span aria-hidden="true">&laquo;</span>
            </a>
        </li>
        <li><a href="second?page=1">1</a></li>
        <li><a href="second?page=2">2</a></li>
        <li><a href="second?page=3">3</a></li>
        <li>
            <a href="second?page=3" aria-label="Next">
                <span aria-hidden="true">&raquo;</span>
            </a>
        </li>
    </ul>
</nav>
<button class="md btn btn-primary btn-lg" type="submit" form="dep-form" formaction="deleteDep">科室删除</button>
<button class="md btn btn-primary btn-lg" type="submit" form="dep-form" formaction="setDep">科室修改</button>
<button class="md btn btn-primary btn-lg" type="submit" form="dep-form" formaction="qh">切换</button>

</body>
</html>